//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { CmsFormFields, CmsFormFieldsResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooCmsFormFieldsList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<CmsFormFieldsResponse>(`/uctoo/cms_form_fields/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooCmsFormFields = async (id: string) => {
  return requestClient.get<CmsFormFields>(`/uctoo/cms_form_fields/${id}`);
};

export const adductooCmsFormFields = async (data: Partial<CmsFormFields>) => {
  return requestClient.post<CmsFormFields>('/uctoo/cms_form_fields/add', data);
};

export const edituctooCmsFormFields = async (data: Partial<CmsFormFields>) => {
  return requestClient.post<CmsFormFields>('/uctoo/cms_form_fields/edit', data);
};

export const deleteuctooCmsFormFields = async (id: string) => {
  return requestClient.post<any>('/uctoo/cms_form_fields/del', { id });
};
